/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mahumLogs.backedbeans;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;

/**
 *
 * @author Edouard
 */
@Entity
public class Promotion implements Serializable{
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int idPromotion;
    private String libelle;
    
    @OneToMany(mappedBy = "promotion",cascade = {CascadeType.PERSIST,CascadeType.REMOVE,CascadeType.REFRESH}) 
    private List<Etudiant> listeEtudiants = new ArrayList<>();

    /**
     * Constructeur vide
     */
    public Promotion() {
        
    }

    /**
     * @return idPromotion (Integer)
     */
    public int getIdPromotion() {
        return idPromotion;
    }

    /**
     * @param idPromotion 
     */
    public void setIdPromotion(int idPromotion) {
        this.idPromotion = idPromotion;
    }

    /**
     * @return libelle (String)
     */
    public String getLibelle() {
        return libelle;
    }

    /**
     * @param libelle 
     */
    public void setLibelle(String libelle) {
        this.libelle = libelle;
    }

    /**
     * @return listeEtudiants (List)
     */
    public List<Etudiant> getListeEtudiants() {
        return listeEtudiants;
    }

    /**
     * @param listeEtudiants 
     */
    public void setListeEtudiants(List<Etudiant> listeEtudiants) {
        this.listeEtudiants = listeEtudiants;
    }
}
